package cate.game.play.skill.active;

import cate.game.play.config.PlayCfgArgs;
import cate.game.play.fighter.Fighter;
import cate.game.play.proce.action.ctx.SkillActionCtx;
import cate.game.play.skill.effect.SkillEffect;

/**
 * 对敌方单体造成224%至320%的随机伤害
 */
public class 星舞剑击AH extends ActiveHandler {

	private double 波动系数;

	//波动系数=9600
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		波动系数 = args.getDouble("波动系数", 0d);
	}

	@Override
	public void beforeSingleEffect(SkillActionCtx action, SkillEffect effect, Fighter target) {
		double coeff = Math.random() * 波动系数;
		effect.getTargetCtx(target.getPid()).addHpCfgByCoeff(coeff);
	}
}
